package purchase.wf;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jbpm.JbpmContext;
import org.jbpm.graph.def.ProcessDefinition;

public class JbpmProcessConsoleAction {

	private Log log = LogFactory.getLog(JbpmProcessConsoleAction.class);
	
	private HttpServletRequest request;
	
	private HttpServletResponse response;
	
	private JbpmContext jbpmContext;

	public JbpmProcessConsoleAction(HttpServletRequest request,
			HttpServletResponse response, JbpmContext jbpmContext) {
		super();
		this.request = request;
		this.response = response;
		this.jbpmContext = jbpmContext;
	}
	
	public void processDefinitionList() {
		List<ProcessDefinition> processDefinitionList = 
			jbpmContext.getGraphSession().findAllProcessDefinitions();
		request.setAttribute("processDefinitionList", processDefinitionList);
	}
	
	
}
